﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 计科2111林开心06
{
    public partial class _3__2_a : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            StruInfoDataContext stu = new StruInfoDataContext();

            var s = from r in stu.Studnet
                    where r.name == DropDownList1.Text
                    select r.id;
            var name = from r in stu.Studnet
                       where r.name == DropDownList1.Text
                       select r.name;

            GridView1.DataSource = name+"";
            GridView1.DataBind();
            
            
        }
    }
}